package IMDBQuery;
import java.util.LinkedList;

/**Clase que representa una instancia de todo el personal (<code>Crew</code>) de la
 * pelicula, directores y escritores.
 * 
 */

public class Crew {

	
	/**Directores de la pelicula
	 */
	private LinkedList<String> directors;
  
	
	/**Escritores de la pelicula
	 */	
	private LinkedList<String> writers;
  
	
  public Crew() {
    directors = new LinkedList(); 
    writers = new LinkedList();
  }
   
  public LinkedList<String> getWriters() {
    return writers;
  }
  
  public void addWriter(String w) {
    writers.add(w);
  }
  
  public int getNumWriters() {
    return writers.size();
  }
  
  public String getWriter(int index) {
    return writers.get(index);
  }
  
  public LinkedList<String> getDirectors() {
    return directors;
  }
  
  public void addDirector(String d) {
    directors.add(d);
  }
  
  public int getNumDirectors() {
    return directors.size();
  }
  
  public String getDirector(int index) {
    return directors.get(index);
  }
  
    public static boolean hasDirector(String director, LinkedList<String> directors) {
            for(int i=0;i<directors.size();i++)
            {
                if(director.equals(directors.get(i)))
                    return true;

            }
            return false;
    }
	
    public static boolean hasWriter(String writer, LinkedList<String> writers) {
            for(int i=0;i<writers.size();i++)
            {
                if(writer.equals(writers.get(i)))
                    return true;

            }
            return false;
    }
  
 }
